package main

import (
	"encoding/json"
	"fmt"
)

type Student2 struct {
	ID     int
	Gender string
	Name   string
	Sno    string
}

func main() {
	var jsonStr = `{"ID":1,"Gender":"男","Name":"李四","Sno":"s0001"}` //定义一个 Monster 实例
	var student Student2
	err := json.Unmarshal([]byte(jsonStr), &student)
	if err != nil {
		fmt.Printf("unmarshal err=%v\n", err)
	}
	fmt.Printf("反序列化后 student=%#v student.Name=%v \n", student, student.Name)

}
